package cn.tedu.review;
/**本类用于复习多线程编辑实现方案1:extends Thread*/
public class TestThread1 {
    public static void main(String[] args) {
        TicketThread t1 = new TicketThread();
        TicketThread t2 = new TicketThread();
        TicketThread t3 = new TicketThread();
        TicketThread t4 = new TicketThread();
        t1.start();
        t2.start();
        t3.start();
        t4.start();
    }
}
class TicketThread extends Thread{
    static int tickets = 100;
    @Override
    public void run() {
        while (true){
            System.out.println(getName()+"="+tickets--);
            if (tickets<=0)break;
        }
    }
}